import { ObjCreate } from "../common/ObjCreate";
import { ImagesConst } from "../../resource/ImagesConst";
import { Language } from "../../../../extend/language/Language";
import { GTextFormat } from "../../../common/GTextFormat";
import { GlobalStyle } from "../../../common/global/GlobalStyle";
import { GTileList } from "../../../../com/mui/controls/GTileList";
import { ScrollBarDirection } from "../../../../fl/controls/ScrollBarDirection";
import { QuestionRankRenderer } from "./QuestionRankRenderer";
import { DataProvider } from "../../../../fl/data/DataProvider";
//class QuestionRankPanel
    
    export  class QuestionRankPanel /* flash.display.Sprite */
    {
        constructor()
        {
            
            this.init();
            return;
        }

        /* internal  */init(): void
        {
            var loc1=ObjCreate.createBg(0, 0, 197, 320, this, ImagesConst.WindowCenterB);
            var loc2=ObjCreate.createBg(0, -3, 200, 35, this, ImagesConst.RbListHeader);
            var loc3=ObjCreate.createTextField(Language.getString(35610), 70, 6, 80, 20, this, new GTextFormat("", 14, 16776960));
            var loc4=ObjCreate.createBg(10, 55, 180, 2, this, ImagesConst.SplitLine);
            var loc5=ObjCreate.createTextField(Language.getString(35611), 20, 35, 30, 20, this, GlobalStyle.textFormat2);
            var loc6=ObjCreate.createTextField(Language.getString(35612), 85, 35, 30, 20, this, GlobalStyle.textFormat2);
            var loc7=ObjCreate.createTextField(Language.getString(35613), 150, 35, 30, 20, this, GlobalStyle.textFormat2);
            this._titleList = new GTileList();
            this._titleList.setSize(190, 230);
            this._titleList.columnWidth = 190;
            this._titleList.rowHeight = 25;
            this._titleList.direction = ScrollBarDirection.VERTICAL;
            this._titleList.horizontalGap = 0;
            this._titleList.verticalGap = 0;
            this._titleList.width = width + 15;
            this._titleList.height = height;
            this._titleList.styleName = "TileList";
            this._titleList.setStyle("skin", new Object /* flash.display.Bitmap */());
            this._titleList.setStyle("cellRenderer", QuestionRankRenderer);
            this._titleList.move(5, 65);
            addChild(this._titleList);
            return;
        }

        public updateRank(arg1: Array<any>): void
        {
            var loc1=null;
            var loc3=0;
            var loc2=[];
            while (loc3 < arg1.length) 
            {
                loc1 = {"index": loc3 + 1, "sQuestionMark": arg1[loc3]};
                loc2.push(loc1);
                ++loc3;
            }
            this._titleList.dataProvider = new DataProvider(loc2);
            return;
        }

        /* internal */ /* var */_titleList: GTileList;
    }
